package fun.formoji.alg.api;


import fun.formoji.alg.api.fallback.BaseDataApiFallBackFactory;
import fun.formoji.alg.resp.BrandPreferenceVO;
import fun.formoji.alg.resp.IdInfoVo;
import fun.formoji.alg.resp.UserLowLoyaltyCategoryVO;
import fun.formoji.alg.resp.UserObItemCategoryVO;
import fun.formoji.commons.model.RestResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author h
 * @date 2021/2/3 16:14
 * @description
 */
@FeignClient(
        value = "alg-service",
        path = "/baseData",
        contextId = "BaseDataApi",
        fallbackFactory = BaseDataApiFallBackFactory.class
)
public interface BaseDataApi {
    @GetMapping(value = "/idInfo", produces = MediaType.APPLICATION_JSON_VALUE)
    RestResponse<IdInfoVo> idInfo(@RequestParam String idType, @RequestParam String idValue);


    @GetMapping(value = "/user/brandPreference")
    RestResponse<BrandPreferenceVO> brandPreference(@RequestParam String userId);

    @GetMapping(value = "/user/lowLoyaltyCategory")
    RestResponse<UserLowLoyaltyCategoryVO> userLowLoyaltyCategory(@RequestParam String userId);

    @GetMapping(value = "/user/obItemCategory")
    RestResponse<UserObItemCategoryVO> userObItemCategory(@RequestParam String userId);

}
